package com.chen.blue.utils;

import com.chen.blue.result.DataResult;
import com.github.pagehelper.PageInfo;

import java.util.List;
import java.util.stream.Collectors;

/**
 * Created By CLT On 2024/4/27.
 */
@SuppressWarnings("all")
public class PageInfoUtil {


    /**
     * 设置返回结果的页面基本信息
     *
     * @param dataResult
     * @param pageInfo
     */
    public static void setPageInfo(DataResult dataResult, PageInfo pageInfo) {

        dataResult.setPageNo(pageInfo.getPageNum());
        dataResult.setPageSize(pageInfo.getPageSize());
        dataResult.setPages(pageInfo.getPages());
        dataResult.setTotal(pageInfo.getTotal());
        dataResult.setHasNext(pageInfo.isHasNextPage());

    }


}
